///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "wxFormBuilder.h"
#include "RenderWin.h"

///////////////////////////////////////////////////////////////////////////

BaseFrame::BaseFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	m_Mainmenubar = new wxMenuBar( 0 );
	m_FileMenu = new wxMenu();
	wxMenuItem* m_menuItemExit;
	m_menuItemExit = new wxMenuItem( m_FileMenu, wx_MainFrame_MenuItem_Exit, wxString( wxT("exit") ) + wxT('\t') + wxT("&E"), wxT("exit"), wxITEM_NORMAL );
	m_FileMenu->Append( m_menuItemExit );
	
	m_Mainmenubar->Append( m_FileMenu, wxT("File") );
	
	this->SetMenuBar( m_Mainmenubar );
	
	wxBoxSizer* m_MainTopSizer;
	m_MainTopSizer = new wxBoxSizer( wxVERTICAL );
	
	m_View = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* m_ViewTopSizer;
	m_ViewTopSizer = new wxBoxSizer( wxVERTICAL );
	
	m_Mainsplitter = new wxSplitterWindow( m_View, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_3DBORDER|wxSP_3DSASH|wxSP_BORDER|wxSP_LIVE_UPDATE|wxSP_NOBORDER|wxSP_NO_XP_THEME|wxSP_PERMIT_UNSPLIT );
	m_Mainsplitter->SetSashGravity( 0.5 );
	m_Mainsplitter->Connect( wxEVT_IDLE, wxIdleEventHandler( BaseFrame::m_MainsplitterOnIdle ), NULL, this );
	m_LeftPanel = new wxPanel( m_Mainsplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* m_LeftWinTopSizer;
	m_LeftWinTopSizer = new wxBoxSizer( wxVERTICAL );
	
	m_LeftNoteBook = new wxNotebook( m_LeftPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
	m_RenderPage = new wxPanel( m_LeftNoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	wxBoxSizer* bSizer10;
	bSizer10 = new wxBoxSizer( wxVERTICAL );
	
	m_RenderWin = new RenderWin(m_RenderPage);
	bSizer10->Add( m_RenderWin, 1, wxALL|wxEXPAND, 5 );
	
	m_RenderPage->SetSizer( bSizer10 );
	m_RenderPage->Layout();
	bSizer10->Fit( m_RenderPage );
	m_LeftNoteBook->AddPage( m_RenderPage, wxT("a page"), false );
	
	m_LeftWinTopSizer->Add( m_LeftNoteBook, 1, wxEXPAND | wxALL, 5 );
	
	m_LeftPanel->SetSizer( m_LeftWinTopSizer );
	m_LeftPanel->Layout();
	m_LeftWinTopSizer->Fit( m_LeftPanel );
	m_RightPanel = new wxPanel( m_Mainsplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
	m_Mainsplitter->SplitVertically( m_LeftPanel, m_RightPanel, 500 );
	m_ViewTopSizer->Add( m_Mainsplitter, 1, wxEXPAND, 5 );
	
	m_View->SetSizer( m_ViewTopSizer );
	m_View->Layout();
	m_ViewTopSizer->Fit( m_View );
	m_MainTopSizer->Add( m_View, 1, wxALL|wxEXPAND, 1 );
	
	this->SetSizer( m_MainTopSizer );
	this->Layout();
	
	// Connect Events
	this->Connect( wxEVT_IDLE, wxIdleEventHandler( BaseFrame::OnIdle ) );
	this->Connect( wxEVT_SIZE, wxSizeEventHandler( BaseFrame::OnSize ) );
	m_Mainsplitter->Connect( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, wxSplitterEventHandler( BaseFrame::OnSplitterChanged ), NULL, this );
}

BaseFrame::~BaseFrame()
{
	// Disconnect Events
	this->Disconnect( wxEVT_IDLE, wxIdleEventHandler( BaseFrame::OnIdle ) );
	this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( BaseFrame::OnSize ) );
	m_Mainsplitter->Disconnect( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, wxSplitterEventHandler( BaseFrame::OnSplitterChanged ), NULL, this );
}

BaseRenderWin::BaseRenderWin( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	
	// Connect Events
	this->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( BaseRenderWin::KeyDown ) );
	this->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( BaseRenderWin::OnLeftButtonDown ) );
	this->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( BaseRenderWin::OnLeftButtonUp ) );
	this->Connect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( BaseRenderWin::OnMiddleDown ) );
	this->Connect( wxEVT_MIDDLE_UP, wxMouseEventHandler( BaseRenderWin::OnMiddleUp ) );
	this->Connect( wxEVT_MOTION, wxMouseEventHandler( BaseRenderWin::OnMouseMove ) );
	this->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( BaseRenderWin::OnMouseWheel ) );
	this->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( BaseRenderWin::OnRightDown ) );
	this->Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( BaseRenderWin::OnRightUp ) );
}
 
BaseRenderWin::~BaseRenderWin()
{
	// Disconnect Events
	this->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( BaseRenderWin::KeyDown ) );
	this->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( BaseRenderWin::OnLeftButtonDown ) );
	this->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( BaseRenderWin::OnLeftButtonUp ) );
	this->Disconnect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( BaseRenderWin::OnMiddleDown ) );
	this->Disconnect( wxEVT_MIDDLE_UP, wxMouseEventHandler( BaseRenderWin::OnMiddleUp ) );
	this->Disconnect( wxEVT_MOTION, wxMouseEventHandler( BaseRenderWin::OnMouseMove ) );
	this->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( BaseRenderWin::OnMouseWheel ) );
	this->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( BaseRenderWin::OnRightDown ) );
	this->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( BaseRenderWin::OnRightUp ) );
}
